//
//  UIColor+Extension.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/4/8.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import Foundation

extension UIColor {
    convenience init(r : CGFloat, g : CGFloat, b : CGFloat) {
        self.init(red: r / 255.0, green: g / 255.0, blue: b / 255.0, alpha: 1.0)
    }
    
    class func randomColor() -> UIColor {
        return UIColor(r: CGFloat(arc4random_uniform(256)), g: CGFloat(arc4random_uniform(256)), b: CGFloat(arc4random_uniform(256)))
    }
    
    
    public func RGBColor(r: CGFloat,g: CGFloat ,b: CGFloat) -> UIColor {
        return UIColor(red: r / 255.0,green: g / 255.0,blue: b / 255.0,alpha: 1)
    }
}
